package com.triones.yjj.service;

import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.triones.yjj.entity.MemberGroupPurchaseDO;
import com.triones.yjj.entity.OrderDO;
import com.triones.yjj.entity.bo.*;
import com.triones.yjj.entity.vo.*;
import org.apache.poi.ss.formula.functions.T;

import java.util.List;
import java.util.Map;

/**
 * 订单相关 service 接口
 *
 * @Author: triones
 */
public interface OrderService {

    /**
     * 订单列表
     * @param params
     * @param pageQuery
     * @return
     */
    TableDataInfo<OrderListVO> pageList(OrderListParams params, PageQuery pageQuery);

    /**
     * 订单统计
     * @param params
     * @return
     */
    Map stats(OrderListParams params);

    WxMemberOrderVoucherVO getMemberOrderVoucher(Long memberId);

    List<ActivityOrderUserVO> getActivityOrderMemberList(Long activityId);

    /**
     * 查询活动所有订单
     * @param activityId
     * @return
     */
    List<ActivityOrderUserVO> getActivityAllOrderList(Long activityId);
    /**
     * 订单详情
     * @param orderId
     * @return
     */
    OrderDetailVO detailById(Long orderId);

    /**
     * 获取客户某个活动带来的订单列表（分页）
     * @param params
     * @param pageQuery
     * @return
     */
    TableDataInfo<OrderListVO> bringOrderPageList(MemberBringOrderListParams params, PageQuery pageQuery);

    /**
     * 活动得最新支付订单列表
     * @param activityId
     * @param pageQuery
     * @return
     */
    TableDataInfo<ActivityOrderUserVO> getActivityPayOrderList(Long activityId, PageQuery pageQuery);

    Long orderCount(WxStaffDetailVO staffVO, Long activityId, Boolean today);

    /**
     * 订单核销(员工)
     * @param staffVO
     * @param orderId
     * @return
     */
    R<T> staffVerificationOrder(WxStaffDetailVO staffVO, Long orderId);

    /**
     * 客户待核销活动订单
     * @param activityId
     * @param memberId
     * @return
     */
    List<ActivityOrderUserVO> getVerificationOrderList(Long activityId,Long memberId);

    /**
     * 订单核销
     * @param dto
     * @return
     */
    Boolean orderVerification(OrderDO dto);

    /**
     * 客户核销订单
     * @param wxStaffDetailVO
     * @param orderId
     * @param staffId
     * @return
     */
    R<T> memberVerificationOrder(MemberDetailVO wxStaffDetailVO, Long orderId, Long staffId);

    TableDataInfo<WxVerificationOrderVO> getVerificationOrderList(WxVerificationOrderParams params, PageQuery pageQuery);

    TableDataInfo<WxStaffOrderVO> orderList(WxStaffDetailVO wxStaffDetailVO, PageQuery pageQuery);

    /**
     * 查询是否成功报名
     * @return
     */
    Map<String,Object> activityIsEnroll(MemberDetailVO memberDetailVO, Long activityId);

    /**
     * 活动订单详情
     * @param id
     * @return
     */
    ActivityOrderUserVO getActivityOrderDetail(Long id);

    TableDataInfo<WxStaffMemberOrderVO> getStaffMemberOrderList(WxStaffMemberOrderParams params, PageQuery pageQuery);

    /**
     * 升为团长
     * @param orderId
     * @return
     */
    Boolean upgrade(Long orderId);

    /**
     * 降为团员
     * @param orderId
     * @return
     */
    Boolean reduce(Long orderId);

    /**
     * 独立成团
     * @param orderId
     * @return
     */
    Boolean isolate(Long orderId);

    /**
     * 分销订单列表
     * @param params
     * @param pageQuery
     * @return
     */
    TableDataInfo<DistributionOrderVO> distributionOrderPageList(MemberDistributionParams params, PageQuery pageQuery);

    /**
     * 移团
     * @param groupPurchaseId
     * @param orderId
     * @return
     */
    Boolean moveToTeam(Long groupPurchaseId, Long orderId);

    /**
     * 修改用户报名信息
     * @param dto
     * @return
     */
    Boolean editEnroll(OrderDO dto);

    /**
     * 调整虚拟团员数量
     * @param orderId
     * @param dto
     * @return
     */
    boolean virtual(Long orderId, MemberGroupPurchaseDO dto);

    /**
     * 批量调整虚拟人数
     * @param bo
     * @return
     */
    boolean batchVirtual(BatchVirtualBO bo);
}
